<?php
// +----------------------------------------------------------------------
// | Longbing [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright Chengdu longbing Technology Co., Ltd.
// +----------------------------------------------------------------------
// | Website http://longbing.org/
// +----------------------------------------------------------------------
// | Sales manager: +86-13558882532 / +86-13330887474
// | Technical support: +86-15680635005
// | After-sale service: +86-17361005938
// +----------------------------------------------------------------------

namespace app\shortvideo\model;
use app\BaseModel;

class ShortvideoCount extends BaseModel{

    protected $name = 'longbing_card_shortvideo_count';

    /**
     **@param $where
     * @param int $page
     * @功能说明: 统计列表查询
     * @author lichuanming
     * @DataTime: 2020/5/20 11:32
     */
    public function countList($where,$page = 10,$order = 'date desc'){
        $list = $this->where($where)->order($order)->paginate($page);
        return !empty($list)?$list->toArray():[];
    }

    /**
     **@author lichuanming
     * @DataTime: 2020/5/20 11:38
     * @功能说明: 保存数据
     */
    public function addCount($data){
        foreach ($data as $key=>$val){
            $data[$key]['create_time'] = time();
        }
        $res = $this->insertAll($data); //添加多条数据
        return $res;
    }

}